# opencv jupyterlab
# 使用 80 端口，工作目录需挂载至 /workspace
FROM python:3.7-buster
MAINTAINER zombie110year <zombie110year@outlook.com>

# 定义变量
## pypi 源，默认使用清华大学镜像
ENV PYPI_URL https://pypi.tuna.tsinghua.edu.cn/simple

# 开放端口
EXPOSE 80
# 挂载工作目录
VOLUME ["/app/workspace", "/app/config"]

# 通过 pip 安装包
RUN pip install -i $PYPI_URL --compile --no-cache-dir numpy
RUN pip install -i $PYPI_URL --compile --no-cache-dir matplotlib
RUN pip install -i $PYPI_URL --compile --no-cache-dir pandas
RUN pip install -i $PYPI_URL --compile --no-cache-dir scipy
RUN pip install -i $PYPI_URL --compile --no-cache-dir opencv-python
RUN pip install -i $PYPI_URL --compile --no-cache-dir jupyterlab

COPY scripts/jupyterlab-config.py /app/config/jupyterlab-config.py

CMD ["jupyter", "lab", "--config=/app/config/jupyterlab-config.py", "--allow-root"]
